Writing equations from word problems